<template>
    <div class="paySuccess" v-loading="loading">
        <div>
            <el-button type="success" icon="el-icon-check" circle></el-button>
        </div>
        <div class="text">支付成功</div>
        <div class="back" @click="goOrder">返回我的订单页面</div>

    </div>
</template>

<script>
import { put } from "@/utils/request";
export default {
    data() {
        return {
            loading: true,
        };
    },
    created() {
        console.log("支付成功页面");
        console.log(11111, this.$route);
        this.paySuccess();
    },
    methods: {
        paySuccess() {
            put("/order/paySuccess", {
                orderId: this.$route.query.out_trade_no,
                payDate: this.$route.query.timestamp,
                payWay: "支付宝",
            }).then((res) => {
                console.log("支付结果", res);
                this.loading = false;
            });
        },
        // 返回订单页面
        goOrder() {
            this.$router.push("/order");
        },
    },
};
</script>
<style lang="scss" scoped>
.paySuccess {
    width: 80%;
    margin: 0 auto;
    height: 150px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ccc;
    .text {
        font-size: 30px;
        font-weight: 700;
        margin: 0 20px;
        vertical-align: middle;
    }
    .back {
        margin-top: 15px;
        &:hover {
            color: skyblue;
            cursor: pointer;
        }
    }
}
</style>
